package com.heima.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.user.pojos.ApUserChannel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ApUserChannelMapper extends BaseMapper<ApUserChannel> {
    
    /**
     * 根据用户ID和频道ID查询订阅关系
     * @param userId 用户ID
     * @param channelId 频道ID
     * @return 订阅关系
     */
    ApUserChannel selectByUserIdAndChannelId(@Param("userId") Integer userId, @Param("channelId") Integer channelId);
    
    /**
     * 根据用户ID查询所有订阅的频道
     * @param userId 用户ID
     * @return 频道列表
     */
    List<ApUserChannel> selectByUserId(@Param("userId") Integer userId);
}
